package com.fengplus.demo.controller;

import com.fengplus.demo.entity.CommonResult;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/feign")
public class FeignController {

    @GetMapping("/a")
    public CommonResult a() {
        return new CommonResult(200, null, "提供者A");
    }

    @GetMapping("/b")
    public CommonResult b() {
        try {
            Thread.sleep(2000);
        }catch (Exception e){
            e.printStackTrace();
        }
        return new CommonResult(200, null, "提供者B");
    }

    @GetMapping("/c")
    public CommonResult c() {
        int i = 10 / 0;
        return new CommonResult(200, null, "提供者C");
    }

}
